import request from '@/utils/http'

// 获取用户订单信息
export function getUserOrder(pageNum, pageSize) {
  return request({
    url: '/order/order/getorderlist',
    method: 'post',
    data: {pageNum, pageSize},
    headers: {
      "Content-Type":"multipart/form-data"
    }
  }) 
}

// 获取用户订单信息
export function getOrderListAPI(userId, storeId, goodId) {
  return request({
    url: '/order/getOrderList',
    method: 'get',
    params: { userId, storeId, goodId }
  })
}

// order页面提交订单
export function addOrderAPI(data) {
  return request({
    url: '/order/addOrder',
    method: 'post',
    data: data,
    headers: {
      "Content-Type":"multipart/form-data"
    }
  })
}

// 更新订单
export function updateOrderAPI(orderId, status) {
  return request({
    url: '/order/updateOrder',
    method: 'put',
    data: { orderId, status },
    headers: {
      "Content-Type": "multipart/form-data"
    }
  })
}

//下单接口
export function paychaseAPI(params) {
  return request({
    url: '/order/paychase',
    method: 'post',
    data: params
  })
}

